﻿<UserControl x:Class="WPFModel.BookUC"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" DataContext="{Binding}" d:DesignHeight="200">
    <!--不要定义绝对精度 如Width="400",影响布置-->

    <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
        <Grid DockPanel.Dock="Top" >
            <Grid.LayoutTransform>
                <ScaleTransform x:Name="scale1" ScaleX="{Binding Path=Value, ElementName=slider1}"
                                ScaleY="{Binding Path=Value,ElementName=slider1}">
                </ScaleTransform>
            </Grid.LayoutTransform>
            <Grid.ColumnDefinitions>
                <ColumnDefinition  Width="Auto"/>
                <ColumnDefinition  Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Label Content="标题" HorizontalAlignment="Left" Margin="10,0,5,0" Name="label1" VerticalAlignment="Center"  />
            <Label Content="出版社"   HorizontalAlignment="Left" Margin="10,0,5,0" Name="label2" VerticalAlignment="Center" Grid.Row="1" />
            <Label Content="ISBN"  HorizontalAlignment="Left" Margin="10,0,5,0" Name="label3" VerticalAlignment="Center" Grid.Row="2"  />
            <TextBox Text="{Binding Path=标题}" Grid.Column="2"  Grid.Row="0" Margin="5"   />
            <TextBox Text="{Binding Path=出版社}" Grid.Column="2" Grid.Row="1"   Margin="5"    />
            <TextBox Text="{Binding Path=ISBN}" Grid.Column="2" Grid.Row="2"  Margin="5" />
            <StackPanel Grid.Row="3"   Margin="5"    Grid.ColumnSpan="2">
                <Button Content="更改书籍"  Margin="5" Name="button2" Click="OnChangeBook" />
                <Button Content="显示书籍"  Margin="5" Name="button1"  Click="OnShowBook" />
            </StackPanel>
        </Grid>
        <StackPanel  Name="stackPanel2"  DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" >
            <Label Content="重置大小"  />
            <Slider  Name="slider1"   Width="148" Minimum="0.4" Maximum="3" Value="1" HorizontalAlignment="Right" />
        </StackPanel>
    </DockPanel>
</UserControl>
